/**
 * @file wa_imgbtn.h
 *
 */

#ifndef _WA_IMGBTN_H
#define _WA_IMGBTN_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
*      INCLUDES
*********************/
#include "wa_conf.h"
#if USE_WA_IMGBTN != 0
#include <string.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdint.h>
#include "wa_area.h"
#include "wa_obj.h"
#include "wa_mask_draw.h"
#include "wa_wm.h"
#include "wa_font.h"
#include "wa_image.h"	
/*********************
*      DEFINES
*********************/


/**********************
*      TYPEDEFS
**********************/

typedef enum
{
	WA_IMGBTN_STATE_DISABLED,
	WA_IMGBTN_STATE_PRESSED,
	WA_IMGBTN_STATE_UNPRESSED,
}wa_imgbtn_state;

typedef enum
{
	WA_IMGBTN_PRESS_OFFSET_UP,
	WA_IMGBTN_PRESS_OFFSET_DOWN,
	WA_IMGBTN_PRESS_OFFSET_LEFT,
	WA_IMGBTN_PRESS_OFFSET_RIGHT,
}wa_imgbtn_press_offset_dir;

typedef struct
{
	wa_bitmap* bitmap;
	wa_gui_color fore_color;
	wa_gui_color back_color;
	wa_imgbtn_state state;
	uint32_t press_offset;
	wa_imgbtn_press_offset_dir offset_dir;
}wa_imgbtn_ext;

/**********************
* GLOBAL PROTOTYPES
**********************/
void wa_imgbtn_module_init(void);
wa_obj* wa_imgbtn_create(wa_obj* par);
void wa_imgbtn_set_bitmap(wa_obj* imgbtn, wa_bitmap* bitmap);
void wa_img_set_fore_color(wa_obj* imgbtn, wa_gui_color fore_color);
void wa_imgbtn_set_back_color(wa_obj* imgbtn, wa_gui_color back_color);
void wa_imgbtn_set_state(wa_obj* imgbtn, wa_imgbtn_state state);
void wa_imgbtn_set_press_offset(wa_obj* imgbtn, uint32_t press_offset);
void wa_imgbtn_set_offset_dir(wa_obj* imgbtn, wa_imgbtn_press_offset_dir offset_dir);
void wa_imgbtn_enable(wa_obj* imgbtn);
void wa_imgbtn_disable(wa_obj* imgbtn);
wa_bitmap* wa_imgbtn_get_bitmap(wa_obj* imgbtn);
wa_gui_color wa_imgbtn_get_fore_color(wa_obj* imgbtn);
wa_gui_color wa_imgbtn_get_back_color(wa_obj* imgbtn);
wa_imgbtn_state wa_imgbtn_get_state(wa_obj* imgbtn);
uint32_t wa_imgbtn_get_press_offset(wa_obj* imgbtn);
wa_imgbtn_press_offset_dir wa_imgbtn_get_offset_dir(wa_obj* imgbtn);
wa_result wa_imgbtn_is_pressed(wa_obj* imgbtn);
/**********************
*      MACROS
**********************/

#endif

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif


